package com.zhoushihao.class0805;
import java.util.Scanner;
public class NumberGame {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] num = new int[4];
        int count = 0;
        int i = 0;
        while(count-num[0]-num[1]-num[2]-num[3]<n){
            int a = 4*i+1;
            int b = 4*i+2;
            int c = 4*i+3;
            int d = 4*i+4;

            if(a%7==0 || Integer.toString(a).contains("7")) num[0]++;
            if(b%7==0 || Integer.toString(b).contains("7")) num[1]++;
            if(c%7==0 || Integer.toString(c).contains("7")) num[2]++;
            if(d%7==0 || Integer.toString(d).contains("7")) num[3]++;

            count+=4;
            i++;
        }
        for (int j = 0; j < 4; j++) {
            System.out.println(num[j]);
        }
    }
}